<?php

require_once('facebook.php');

$facebook = new Facebook("87c749ab2b66ec2c60f542d13647555c","a9502b949632873d575cb6242eb4d525");

$fb_user = $facebook->require_login();

$q=$_GET["q"];

$fields = array('last_name','first_name', 'pic', 'relationship_status', 'affiliations', 'hometown_location', 'meeting_sex', 'pic_square');

$info = $facebook->api_client->users_getInfo($q, $fields);

$pic = $info[0]['pic'];
$fname = $info[0]['first_name'];
$lname = $info[0]['last_name'];
$rs = $info[0]['relationship_status'];

if($info[0]['affiliations']['length'] == 0){
	$aff = "";
}
else{
	$aff = $info[0]['affiliations'][0]['name'];
}  

$intin = $info[0]['meeting_sex']['sex'];
$pic_square = $info[0]['pic_square'];

$hl = "";

if($info[0]['hometown_location']['city'] != "")
$hl = $hl.$info[0]['hometown_location']['city'].", ";
if($info[0]['hometown_location']['state'] != "")
$hl = $hl.$info[0]['hometown_location']['state'].", ";
if($info[0]['hometown_location']['country'] != "")
$hl = $hl.$info[0]['hometown_location']['country'];

echo $pic."*-+".$fname." ".$lname."*-+".$rs."*-+".$aff."*-+".$hl."*-+".$intin."*-+".$pic_square."*-+";

?>

